﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;

namespace RulesCore
{
    class IfThenRule : BaseRule
    {
        //
        private string _IF;
        private string _THEN;
        private BaseRule IfRule;
        private BaseRule ThenRule;
        private int IfChecked = 0;

        public IfThenRule(BaseRule IFRule, BaseRule THENRule)
        {
            this.IfRule = IFRule;
            this.ThenRule = THENRule;
        }

        public override bool ChekRule()
        {
            if (IfRule.ChekRule())
                return ThenRule.ChekRule();
            else
                return true;
        }
    }
}